import request from '@/utils/request'

const baseUrl = '/prot/cinnamon-product'

export function getPriceTrend(params) {
  return request({
    url: `${baseUrl}/trend`,
    method: 'get',
    params: params
  })
}

export function getProductPricePage(params) {
  return request({
    url: `${baseUrl}`,
    method: 'get',
    params: params
  })
}

export function getProductPriceById(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'get'
  })
}

export function saveProductPrice(productPrice) {
  return request({
    url: `${baseUrl}`,
    method: 'post',
    data: productPrice
  })
}

export function updateProductPrice(productPrice) {
  return request({
    url: `${baseUrl}`,
    method: 'put',
    data: productPrice
  })
}
export function deleteProductPriceById(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'delete'
  })
}

export function deleteProductPriceBatch(ids) {
  return request({
    url: `${baseUrl}/batch`,
    method: 'delete',
    params: { ids: ids }
  })
}

